package fr.vince.java.rps_game;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Player {

	private String name;
	private int score;
	private List<RPSEnum> moves;
	
	public Player(String pname){
		name = pname;
		Random rand = new Random();
		moves = new ArrayList<RPSEnum>();
		for (int i=0;i<20;i++){
			int machin = rand.nextInt(4);
			switch(machin){
			case 1:
				moves.add(RPSEnum.ROCK);
				break;
			case 2:
				moves.add(RPSEnum.PAPER);
				break;
			case 3:
				moves.add(RPSEnum.SCISSORS);
				break;
			}
		}
		score = 0;
	}
	
	public Player(String pname,List<RPSEnum> pmoves){
		name = pname;
		moves = pmoves;
		score = 0;
	}
	
	public String getName(){
		return name;
	}
	
	public int getScore(){
		return score;
	}
	
	public int getNumberOfMoves(){
		return moves.size();
	}
	
	public RPSEnum getNextMove(){
		return moves.remove(0);
	}
	
	public void setScore (int val){
		score = val;
	}
}
